package com.jhgsys.internal.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jhgsys.internal.common.converter.TimeConverter;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * @author MrBird
 */
@Data
@TableName("BASIC_DEPT")
@Excel("部门信息表")
public class Dept implements Serializable {

    private static final long serialVersionUID = 5702271568363798328L;
    /**
     * 部门 ID
     */
    @TableId(value = "DEPT_ID", type = IdType.ASSIGN_UUID)
    private String deptId;

    /**
     * 上级部门 ID
     */
    @TableField("PARENT_ID")
    private String parentId;

    /**
     * 租户 ID
     */
    @TableField("TENANT_ID")
    private String tenantId;

    /**
     * 机构类型 1：本部 2：部门 3：科室 4：职场 5：班组
     */
    @TableField("DEPT_TYPE")
    private String deptType;

    /**
     * 部门名称
     */
    @TableField("DEPT_NAME")
    @Size(max = 10, message = "{noMoreThan}")
    @ExcelField(value = "部门名称")
    private String deptName;

    /**
     * 部门编号
     */
    @TableField("DEPT_CODE")
    @Size(max = 10, message = "{noMoreThan}")
    @ExcelField(value = "部门编号")
    private String deptCode;

    /**
     * 业务编号（影响业务模块中编码生成格式）
     */
    @TableField("business_code")
    @Size(max = 64, message = "{noMoreThan}")
    @ExcelField(value = "业务编号")
    private String businessCode;

    /**
     * 排序
     */
    @TableField("ORDER_NUM")
    private Long orderNum;

    /**
     * 创建人id
     */
    @TableField("CREATED_BY")
    @ExcelField("创建人id")
    private String createdBy;
    /**
     * 创建时间
     */
    @TableField("CREATED_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelField(value = "创建时间", writeConverter = TimeConverter.class)
    private Date createTime;
    /**
     * 更新人id
     */
    @TableField("UPDATED_BY")
    @ExcelField("更新人id")
    private String updatedBy;
    /**
     * 更新时间
     */
    @TableField("UPDATED_TIME")
    @ExcelField(value = "修改时间", writeConverter = TimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date modifyTime;
    /**
     * 删除人id
     */
    @TableField("DELETED_BY")
    @ExcelField("删除人id")
    private String deletedBy;
    /**
     * 删除时间
     */
    @TableField("DELETED_TIME")
    @ExcelField(value = "删除时间", writeConverter = TimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deletedTime;
    /**
     * 删除标记
     */
    @TableField("DELETED_FLG")
    @ExcelField("删除标记")
    private String deletedFlg;

    /**
     * 状态 0禁用 1启用
     */
    @TableField("STATUS")
    @ExcelField(value = "状态", writeConverterExp = "0=禁用,1=启用")
    private String status;


    /**
     * 人员名称
     */
    @ExcelField(value = "人员")
    @TableField(exist = false)
    private String usernamelist;


    /**
     * 工厂id ID
     */
    @TableField(exist = false)
    private Integer plaId;

}


